<!-- #INCLUDE Virtual="/lib.asp" -->
<!-- #INCLUDE Virtual="/lib_gen.asp" -->

<%
dim rss, objXMLDom, objXMLdata
dim rssTitle, rssInhoud, rssImage
rssInhoud = "Geen RSS data ontvangen"

rss = getExternalHTML("http://www.nu.nl/feeds/rss/tag/politie.rss")

Set objXMLDom = Server.CreateObject("Microsoft.XMLDOM")
objXMLDom.preserveWhiteSpace = true
objXMLDom.async = false
objXMLDom.resolveExternals = false

'objXMLDom.setProperty "SelectionNamespaces", "xmlns:media='http://search.yahoo.com/mrss/'"

on error resume next

objXMLDom.loadXML(rss)
Set objXMLdata = objXMLDom.documentElement
for each item in objXMLdata.selectNodes("//item[0]")
	rssTitle = trim(item.selectSingleNode("title").text)
	rssInhoud = replace(item.selectSingleNode("description").text, "&nbsp;", " ")
	rssInhoud = replace(rssInhoud, chr(10), "")
	rssInhoud = replace(rssInhoud, chr(160), "")
	rssInhoud = replace(rssInhoud, chr(32), " ")
	rssInhoud = replace(rssInhoud, "<p>", "")
	rssInhoud = replace(rssInhoud, "</p>", "")
	rssInhoud = trim(rssInhoud)
	rssCodes = ""
	for t=1 to len(rssInhoud)
		rssCodes = rssCodes & asc(mid(rssInhoud,t,1)) & " "
	next
	rssImage = ""
	
	' <enclosure url="http://bin.snmmd.nl/m/m1nx3sraitsa_sqr256.jpg" type="image/jpeg"/>
	for each media in item.selectNodes("./enclosure[@type='image/jpeg']")
		if rssImage = "" then rssImage = media.getAttribute("url")
	next
next

call generatePage(request("preview"), request.querystring("nextpage"), rssTitle, rssImage, rssInhoud)
%>